<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
    let obj = {
        user_name: 'name1',
        user_id: 1000,
        age: 10,
        detail: {
            user_avatar_url: 'xxx',
            object_one: {
                a_num: 1,
                str: 'str1'
            },
            array_one: [
                    [ 
                        {
                            a_num: 111,
                            b_num: 222
                        }
                    ],
                    [
                        {
                            c_obj: {
                            c_num: 333,
                            str: 'str111'
                            }
                        }
                    ]
                ]
            }
        }
function clone(target,map = new WeakMap ()){
    if(typeof target === 'object'){
        let cloneTarget = Array.isArray(target)?[]:{}
        if(map.get(target)){
            return target;
        }
        map.set(target,cloneTarget)
        for (const key in target){
            if(key.includes("_")){
                let arr = key.split("_");
                for(var i=1;i<arr.length;i++){
                    arr[i] = arr[i].substring(0,1).toUpperCase()+arr[i].substring(1)
                }
                cloneTarget[arr.join("")] = clone(target[key],map)
               
            }else{
                cloneTarget[key] = clone(target[key],map)
            }
             
        }
        return cloneTarget
    }else{
        return target
    }
}
let result = clone(obj)
console.log(result)
function forEach(array,iteratee){
    let index = -1;
    const length = array.length;
    while(++index<length){
        iteratee(array[index],index)
    }
    return array
}

    </script>
</body>
</html>